package eu.nikoladichev.test.mdb;

import java.util.logging.Logger;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import javax.naming.NamingException;

/**
 * Message-Driven Bean implementation class for: MishoMDB
 *
 */
@MessageDriven(
		activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
							 @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/GoshoOtPochivka") ,
							 @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")
						   }
			  )
public class GoshoOtPochivkaMDB implements MessageListener {

	Logger logger = Logger.getLogger(GoshoOtPochivkaMDB.class.getSimpleName());
	
	public void onMessage(Message message) {
    	
    }
    
    public void processMessage(Message message) throws JMSException, NamingException {
    	TextMessage msg = (TextMessage) message;
    	logger.info("GoshoOtPochivka message body: " + msg.getText());
    	logger.info("MDB Test ended!");
    }
}
